
#ifndef BSP_UART_PRE 
#define BSP_UART_PRE 


#ifdef  BSP_UART_MOD
#define BSP_UART_EXT
#else
#define BSP_UART_EXT extern
#endif

#include "FreeRTOS.h"
#include "semphr.h"
#include "stm32f0xx_hal_uart.h"


#define BSP_UART_RX_QUEUE_LEN 8



typedef struct
{
  UART_HandleTypeDef huart1;

	SemaphoreHandle_t lock;
	SemaphoreHandle_t tx_cplt;
	SemaphoreHandle_t rx_cplt;	
	QueueHandle_t queue;
}tUART;




BSP_UART_EXT tUART bsp_uart;


BSP_UART_EXT BaseType_t bsp_uart_tx_wait(tUART *uart);
BSP_UART_EXT BaseType_t bsp_uart_rx_wait(tUART *uart, TickType_t tim_out);
BSP_UART_EXT HAL_StatusTypeDef bsp_uart_init(tUART *uart);
BSP_UART_EXT void bsp_uart_send_data(uint8_t *data, uint16_t len);
BSP_UART_EXT void bsp_uart_send_str(char *str);















#endif
